package com.example.yuejian.fragment.club;

import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.example.yuejian.R;


public class ClubIntroFragment extends Fragment {

private View view;

    private TextView intro,address,tel,time;
    private LinearLayout call;
    Bundle bundle;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) {


        view = inflater.inflate(R.layout.fragment_club_inro, container, false);
        initView();
        return view;

    }

    private void initView(){
        Intent intent = getActivity().getIntent();
        bundle = intent.getExtras();
        intro =(TextView)view.findViewById(R.id.intro);
        intro.setText(bundle.getString("clubintro"));
        address =(TextView)view.findViewById(R.id.address);
        address.setText(bundle.getString("clubaddress"));
        tel =(TextView)view.findViewById(R.id.address);
        tel.setText(bundle.getString("clubtel"));
        time=(TextView)view.findViewById(R.id.address);
        time.setText(bundle.getString("clubtime"));
        call=(LinearLayout)view.findViewById(R.id.call);
        call.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:"+bundle.getString("clubtel")));
                startActivity(intent);
            }
        });
    }
}